﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using ViewComponents.PowerPoint.ViewModels;

namespace ViewComponents.Converters
{
    public class ExcelSourceTypeToTextConverter : IValueConverter
    {
        const string LITERAL_TYPE_TEXT = "Simple Cell Reference";
        const string LOOKUPSTEP_RANGE_TYPE_TEXT = "Look-up Steps";

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //if (value == null) return string.Empty;
            if (value == string.Empty) return string.Empty;

            switch ((ExcelSourceType)value)
            {
                case ExcelSourceType.Simple:
                    return LITERAL_TYPE_TEXT;

                case ExcelSourceType.LookUpSteps:
                    return LOOKUPSTEP_RANGE_TYPE_TEXT;

                default:
                    return string.Empty;
                    //throw new InvalidOperationException("Source object type is not valid.");
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value;
        }
    }
}
